import request from '@/utils/request'
/* 路由相关接口*/
export function getRoutes(data = {
	menu_status: '1'
}) {
	return request({
		url: '/Man/Role/manRule',
		method: 'post',
		data
	})
}
export function getRouteTree(data = {}) {
	return request({
		url: '/Man/Role/manRule',
		method: 'post',
		data
	})
}
// 新增权限
export function addRoute(data) {
	return request({
		url: '/Man/Role/setRule',
		method: 'post',
		data
	})
}
// 编辑权限
export function editRoute(data) {
	return request({
		url: '/Man/Role/setRule',
		method: 'post',
		data
	})
}
export function delRouter(data) {
	return request({
		url: '/Man/Role/ruleDel',
		method: 'post',
		data
	})
}
// 获取需要验证的权限
export function showRuleApi(data = {}) {
	return request({
		url: '/Man/Role/showRule',
		method: 'post',
		data
	})
}
// 员工工选择角色组
export function getGroupApi() {
	return request({
		url: '/admin/group',
		method: 'post'
	})
}
// 新增角色组
export function addRole(data) {
	return request({
		url: '/Man/Role/setGroup',
		method: 'post',
		data
	})
}
// 修改角色组
export function updateRole(data) {
	return request({
		url: `/Man/Role/setGroup`,
		method: 'post',
		data
	})
}
// 关联用户
export function associatedMan(data) {
	return request({
		url: `/Man/Role/associatedMan`,
		method: 'post',
		data
	})
}
// 删除员工
export function deleteRole(data) {
	return request({
		url: `/Company/CompanyMan/delInfo`,
		method: 'post',
		data
	})
}
/* 管理员相关接口*/
export function getAdmin(data) {
	return request({
		url: `/Company/Department/getTree`,
		method: 'post',
		data
	})
}
export function addDepartment(data) {
	return request({
		url: `/Company/Department/edit`,
		method: 'post',
		data
	})
}
export function editAdmin(data) {
	return request({
		url: `/Company/Main/editMan`,
		method: 'post',
		data
	})
}
export function setAdminStatus(data) {
	return request({
		url: `/Company/Main/updownMan`,
		method: 'post',
		data
	})
}
export function delAdmin(data) {
	return request({
		url: `/Man/Admin/del`,
		method: 'post',
		data
	})
}
export function resetPwdAdmin(data) {
	return request({
		url: `/Man/Admin/resetPwd`,
		method: 'post',
		data
	})
}
/* 员工列表*/
export function getWorkderList(data = {}) {
	return request({
		url: '/Company/CompanyMan/getList',
		method: 'post',
		data
	})
}
/* 员工启用停用*/
export function setWorkerStatus(data = {}) {
	return request({
		url: '/Company/CompanyMan/updown',
		method: 'post',
		data
	})
}
/* 新建编辑员工*/
export function editWorkder(data = {}) {
	return request({
		url: '/Company/CompanyMan/edit',
		method: 'post',
		data
	})
}
/* 迁移数据*/
export function moveData(data = {}) {
	return request({
		url: '/Jfcrm/Clue/moveData',
		method: 'post',
		data
	})
}
/* 删除部门*/
export function delInfo(data = {}) {
	return request({
		url: '/Company/Department/delInfo',
		method: 'post',
		data
	})
}